import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Demo01 {
    public static void main(String[] args) {
        Map<String,String> hashMap=new HashMap<>();
        hashMap.put("username","黄石阿凯");
        hashMap.put("address","湖北黄石");
        hashMap.put("gender","男");
        hashMap.put("age","18");
        System.out.println(hashMap);
        Set<String> keys=hashMap.keySet();
        for(String key:keys){
            String value=hashMap.get(key);
            System.out.println("key:"+key+"---->value:"+value);
        }
        Collection<String> values=hashMap.values();
        for(String value:values){
            System.out.println(value);
        }
        System.out.println(hashMap.size());
    }
}
